<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>module (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">module</span>
</div>

<hr/>


  <h2>Classes</h2>
 <div class="fn-constructor">
        <a href="interface_goog_module_AbstractModuleLoader.html">
          goog.module.AbstractModuleLoader</a><br/>
        <div class="class-details">An interface that loads JavaScript modules.
</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_module_BaseModule.html">
          goog.module.BaseModule</a><br/>
        <div class="class-details">A basic module object that represents a module of Javascript code that can
be dynamically loaded.

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_module_Loader.html">
          goog.module.Loader</a><br/>
        <div class="class-details">The dynamic loading functionality is defined as a class. The class
will be used as singleton. There is, however, a two step
initialization procedure because parameters need to be passed to
the goog.module.Loader instance.

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_module_ModuleInfo.html">
          goog.module.ModuleInfo</a><br/>
        <div class="class-details">A ModuleInfo object is used by the ModuleManager to hold information about a
module of js code that may or may not yet be loaded into the environment.

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_module_ModuleLoadCallback.html">
          goog.module.ModuleLoadCallback</a><br/>
        <div class="class-details">Class used to encapsulate the callbacks to be called when a module loads.
</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_module_ModuleLoader.html">
          goog.module.ModuleLoader</a><br/>
        <div class="class-details">A class that loads Javascript modules.
</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_module_ModuleManager.html">
          goog.module.ModuleManager</a><br/>
        <div class="class-details">The ModuleManager keeps track of all modules in the environment.
Since modules may not have their code loaded, we must keep track of them.
</div>
 </div>
   
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.module.initLoader"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.module.</span><span class="entryName">initLoader<span class="args">(<span class="arg">urlBase</span>,&nbsp;<span class="arg">opt_urlFunction</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Wrapper of init() so that we only need to export this single
identifier instead of three. See method goog.module.Loader.init() for
explanation of param.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">urlBase</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The URL of the base library.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_urlFunction</span>
        : <span class="type">Function=</span>
        <div class="entryOverview">Function that creates the URL for the
    module file. It will be passed the base URL for module files and the
    module name and should return the fully-formed URL to the module file to
    load.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_module_module.js.source.html#line76">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.module.isNull_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.module.</span><span class="entryName">isNull_<span class="args">(<span class="arg">el</span>,&nbsp;<span class="arg">i</span>,&nbsp;<span class="arg">arr</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Checks if the given element is null.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">el</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>
        <div class="entryOverview">The element to check if null.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">i</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The index of the element.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">arr</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>&gt;
        <div class="entryOverview">The array that contains the element.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            TRUE iff the element is null.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_module_module.js.source.html#line164">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.module.loaderCall"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.module.</span><span class="entryName">loaderCall<span class="args">(<span class="arg">module</span>,&nbsp;<span class="arg">symbol</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
      </div>


     <div class="entryOverview">
       Produces a function that delegates all its arguments to a
dynamically loaded function. This is used to export dynamically
loaded functions.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">module</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The module to load from.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">symbol</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The ID of the symbol to load from the module.
    This symbol must resolve to a function.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>&nbsp;
            A function that forwards all its arguments to
    the dynamically loaded function specified by module and symbol.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_module_module.js.source.html#line92">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.module.provide"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.module.</span><span class="entryName">provide<span class="args">(<span class="arg">module</span>,&nbsp;<span class="arg">opt_symbol</span>,&nbsp;<span class="arg">opt_object</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Wrapper of goog.module.Loader.provide() for use in modules
See method goog.module.Loader.provide() for explanation of params.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">module</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The name of the module. Cf. parameter module
    of method require().</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_symbol</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span><span>&nbsp;|&nbsp;</span><span class="type">string=</span>
        <div class="entryOverview">The symbol being defined, or nothing
    when all symbols of the module are defined. Cf. parameter symbol of
    method require().</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_object</span>
        : <span class="type">Object=</span>
        <div class="entryOverview">The object bound to the symbol, or nothing when
    all symbols of the module are defined.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_module_module.js.source.html#line59">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.module.require"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.module.</span><span class="entryName">require<span class="args">(<span class="arg">module</span>,&nbsp;<span class="arg">symbol</span>,&nbsp;<span class="arg">callback</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Wrapper of goog.module.Loader.require() for use in modules.
See method goog.module.Loader.require() for
explanation of params.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">module</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The name of the module. Usually, the value
    is defined as a constant whose name starts with MOD_.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">symbol</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The ID of the symbol. Usually, the value is
    defined as a constant whose name starts with SYM_.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">callback</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">This function will be called with the
    resolved symbol as the argument once the module is loaded.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_module_module.js.source.html#line42">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.module.requireMultipleSymbols"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.module.</span><span class="entryName">requireMultipleSymbols<span class="args">(<span class="arg">symbolRequests</span>,&nbsp;<span class="arg">finalCb</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Requires symbols for multiple modules, and invokes a final callback
on the condition that all of them are loaded. I.e. a barrier for
loading of multiple symbols. If no symbols are required, the
final callback is called immediately.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">symbolRequests</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>&gt;
        <div class="entryOverview">A
    list of tuples of module, symbol, callback (analog to the arguments
    to require(), above). These will each be require()d
    individually. NOTE: This argument will be modified during execution
    of the function.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">finalCb</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">A function that is called when all
    required symbols are loaded.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_module_module.js.source.html#line116">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.module.requireMultipleSymbolsHelper_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.module.</span><span class="entryName">requireMultipleSymbolsHelper_<span class="args">(<span class="arg">symbolRequests</span>,&nbsp;<span class="arg">i</span>,&nbsp;<span class="arg">finalCb</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Used by requireMultipleSymbols() to load each required symbol and
keep track how many are loaded, and finally invoke the barrier
callback when they are all done.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">symbolRequests</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span>&gt;
        <div class="entryOverview">Same as in
    requireMultipleSymbols().</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">i</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The single module that is required in this invocation.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">finalCb</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">Same as in requireMultipleSymbols().</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_module_module.js.source.html#line139">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



  <h2>Global Properties</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.module.ModuleInfoTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.module.</span><span class="entryName">ModuleInfoTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_module_moduleinfo_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.module.ModuleLoadCallbackTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.module.</span><span class="entryName">ModuleLoadCallbackTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_module_moduleloadcallback_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.module.ModuleLoaderTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.module.</span><span class="entryName">ModuleLoaderTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_module_moduleloader_test.js.source.html#line20">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.module.ModuleManagerTest"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.module.</span><span class="entryName">ModuleManagerTest</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_module_modulemanager_test.js.source.html#line15">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.module.testdata"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.module.</span><span class="entryName">testdata</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_module_testdata_modA_1.js.source.html#line20">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package module</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="module"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
